import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.renren.entity.ServiceSettlementMainEntity;
import io.renren.utils.Global;
import io.renren.utils.HttpClientUtils;
import io.renren.utils.Sha1Util;
import org.apache.commons.collections.map.HashedMap;

import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/6/15 0015.
 */
public class test {

    public static void testHttp() throws IOException{
        JSONObject obj = new JSONObject();
        String data = "[{\"sex\":\"男\",\"startDate\":\"2016-10-10\",\"u_xz\":\"0\",\"u_gwbh\":\"5\",\"status\":\"0\",\"birthDate\":\"2016-10-10\",\"firstName\":\"luna\",\"passportNo\":\"AEQ\",\"lastName\":\"25\"}]";
        Map<String,Object> map = new HashMap<>();
        map.put("data",data);
        String sign = Sha1Util.SHA1(map, "huashun");
        obj.put("data",data);
        obj.put("sign",sign);
        URL uploadServlet = new URL("http://172.16.90.159:8085/huashun/addBatchEmployee");
        HttpURLConnection servletConnection = (HttpURLConnection) uploadServlet.openConnection();
        // 设置连接参数
        servletConnection.setRequestMethod("POST");
        servletConnection.setDoOutput(true);
        servletConnection.setDoInput(true);
        servletConnection.setAllowUserInteraction(true);

        // 开启流，写入XML数据
        OutputStream output = servletConnection.getOutputStream();
        output.write(obj.toString().getBytes());
        output.flush();
        output.close();
    }

    /**
     * 批量添加员工测试通过
     * @param args
     * @throws Exception
     */
    public static void addBatchEmpToB1() throws Exception {
        Map<String, Object> queryParams = new HashedMap();
        JSONArray dataList = new JSONArray();
        String key = Global.getConfig("b1key");// 获取key
        String url = Global.getConfig("b1url9");// 获取url
        String testString = "[{\"sex\":\"0\",\"startDate\":1501603200000,\"termDate\":\"\"," +
                "\"u_xz\":\"0\",\"u_gwbh\":\"5\",\"status\":\"0\",\"birthDate\":1502035200000," +
                "\"firstName\":\"luna\",\"passportNo\":\"AEQ\",\"lastName\":25}]";
        JSONObject json = new JSONObject();
        json.put("firstName","luna");
        json.put("lastName","");
        json.put("birthDate","2016-10-10");
        json.put("passportNo","454544554511311");
        json.put("sex","0");
        json.put("status","2");
        json.put("startDate","2016-10-10");
        json.put("termDate","2016-10-10");
        json.put("u_gwbh","5");
        json.put("u_xz","1");
       /* String ss = "[{“firstName”:”三”,”lastName”:”张”,”birthDate”:”1990-01-01”,”passportNo”:”421126199001011739”,”sex”:”F”,”status”:”1”,”startDate”:”2016-10-10”,”termDate”:”2019-10-10”,”u_gwbh”:”1001”,”u_xz”:”1”},{“firstName”:”四”,”lastName”:”李”,”birthDate”:”1990-01-01”,”passportNo”:”421126199001011739”,”sex”:”F”,”status”:”1”,”startDate”:”2016-10-10”,”termDate”:”2019-10-10”,”u_gwbh”:”1001”,”u_xz”:”1”}]";*/
        dataList.add(json);
        queryParams.put("data",dataList);
        String sign = Sha1Util.SHA1(queryParams, key);// 计算签名
        //queryParams.put("sign",sign);

        System.out.println("data:" + dataList.toJSONString());
        System.out.println("url:" + url);
        System.out.println("sign:" + sign);

        JSONObject doc = new JSONObject();
        doc.put("data",dataList.toJSONString());
        doc.put("sign",sign);

        String result = HttpClientUtils.doPost(url, doc);// 发送请求
        System.out.println("请求的结果:"+result);
    }

    /**
     * 把String当Json测试批量添加员工
     * @throws Exception
     */
    public static void testStringAsJson() throws Exception{
        Map<String, Object> queryParams = new HashedMap();

        String key = Global.getConfig("b1key");// 获取key
        String url = Global.getConfig("b1url9");// 获取url
        String testString = "[{\"sex\":\"0\",\"startDate\":1501603200000,\"termDate\":\"\"," +
                "\"u_xz\":\"0\",\"u_gwbh\":\"5\",\"status\":\"0\",\"birthDate\":1502035200000," +
                "\"firstName\":\"luna\",\"passportNo\":\"AEQ\",\"lastName\":25}]";

        queryParams.put("data",testString);
        String sign = Sha1Util.SHA1(queryParams, key);// 计算签名
        queryParams.put("sign",sign);

        String result = HttpClientUtils.doPost(url, queryParams);// 发送请求
        System.out.println("请求的结果:"+result);

    }

    public static void testStr(){
        StringBuffer sb = new StringBuffer("select ");
        ServiceSettlementMainEntity ssMain = new ServiceSettlementMainEntity();
        Class ssclass = ssMain.getClass();
        Field[] fs = ssclass.getDeclaredFields();
        for (Field f : fs) {
            f.setAccessible(true);
            String name = f.getName();
            Type type = f.getGenericType();
            System.out.println(type);
            sb.append("sum("+name+") "+name + ",");
        }
        String sql = sb.substring(0,sb.length()-1);
        sql += " from service_settlement_main";
        System.out.println(sql);
    }

    public static void testJSONArray(){
        String jsonStr = "{\"code\":0,\"list\":{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000\",\"createBy\":\"1\",\"createDate\":\"2013-05-27 08:00:00\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"58616106\",\"grade\":\"1\",\"id\":1,\"isleaf\":null,\"level\":null,\"list\":[{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:28:56\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"58616106\",\"grade\":\"1\",\"id\":2,\"isleaf\":null,\"level\":null,\"list\":[{\"address\":\"\",\"areaId\":\"90e38569c423465f87607a48ccf1a512\",\"code\":\"100000001014\",\"createBy\":\"df5609891cde43039edca2aa3adc3b86\",\"createDate\":\"2017-03-01 17:24:22\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":6,\"isleaf\":null,\"level\":null,\"list\":[{\"address\":null,\"areaId\":\"1\",\"code\":null,\"createBy\":\"1\",\"createDate\":\"2017-06-15 11:09:30\",\"delFlag\":\"0\",\"deputyPerson\":\"1\",\"email\":null,\"expanded\":null,\"fax\":null,\"grade\":\"2\",\"id\":21,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":null,\"name\":\"光谷分部33\",\"parent\":null,\"parentId\":\"6\",\"phone\":null,\"primaryPerson\":null,\"remarks\":null,\"sort\":30,\"type\":\"2\",\"updateBy\":\"1\",\"updateDate\":\"2017-06-15 11:09:35\",\"useable\":null,\"zipCode\":null},{\"address\":null,\"areaId\":\"1\",\"code\":null,\"createBy\":\"1\",\"createDate\":\"2017-06-15 11:09:30\",\"delFlag\":\"0\",\"deputyPerson\":\"1\",\"email\":null,\"expanded\":null,\"fax\":null,\"grade\":\"2\",\"id\":22,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":null,\"name\":\"广埠屯分部zh\",\"parent\":null,\"parentId\":\"6\",\"phone\":null,\"primaryPerson\":null,\"remarks\":null,\"sort\":30,\"type\":\"2\",\"updateBy\":\"1\",\"updateDate\":\"2017-06-15 11:09:35\",\"useable\":null,\"zipCode\":null}],\"loaded\":null,\"master\":\"\",\"name\":\"武汉分公司\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:24:22\",\"useable\":\"1\",\"zipCode\":\"\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001006\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:34:51\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":7,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"客服二部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"58624165\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:18\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"耒阳市电厂\",\"areaId\":\"91c849f669594b33a0c4a251bac8a277\",\"code\":\"100000001001010\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:37:25\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":8,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"耒阳项目部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:47\",\"useable\":\"1\",\"zipCode\":\"\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001002\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:57:47\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":9,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"总经办\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:19:06\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001004\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:33:42\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":10,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"招聘部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:04\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"株洲市\",\"areaId\":\"c4aa5b53a42e439c8080d25c890031b0\",\"code\":\"100000001001011\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:38:36\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":11,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"株洲办事处\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:59\",\"useable\":\"1\",\"zipCode\":\"\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"7eea82efcebe4cce88281f3db35983b9\",\"code\":\"100000001001001\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:31:55\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":12,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"行政人事部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"1\",\"updateDate\":\"2017-04-19 16:04:50\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001003\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:33:02\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":13,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"风险管控部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:17:57\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001002\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:32:32\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":14,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"财务部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"58624163\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:17:47\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001009\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:36:26\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":15,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"洪盛项目部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:31\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"\",\"areaId\":\"ef361c79127e4dd78eeae0d0a4db5c33\",\"code\":\"100000005\",\"createBy\":\"df5609891cde43039edca2aa3adc3b86\",\"createDate\":\"2017-03-01 17:24:00\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":16,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"郴州分公司\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:24:00\",\"useable\":\"1\",\"zipCode\":\"\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001007\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:35:21\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":17,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"项目管理部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"58624165\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:25\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001008\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:35:56\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":18,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"板材项目部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:39\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湘潭市芙蓉中路19号\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000001001005\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:34:16\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"2\",\"id\":19,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"客服一部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"58624165\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"df5609891cde43039edca2aa3adc3b86\",\"updateDate\":\"2017-03-01 17:18:12\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"湖南湘潭\",\"areaId\":\"124122\",\"code\":\"12131\",\"createBy\":null,\"createDate\":null,\"delFlag\":\"0\",\"deputyPerson\":\"付海军\",\"email\":null,\"expanded\":null,\"fax\":\"312313\",\"grade\":\"2\",\"id\":23,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"付海军\",\"name\":\"研发部\",\"parent\":null,\"parentId\":\"2\",\"phone\":\"12313432532\",\"primaryPerson\":\"付海军\",\"remarks\":null,\"sort\":null,\"type\":\"3\",\"updateBy\":null,\"updateDate\":null,\"useable\":\"1\",\"zipCode\":\"432211\"}],\"loaded\":null,\"master\":\"\",\"name\":\"湖南华顺人力资源服务管理股份有限公司\",\"parent\":null,\"parentId\":\"1\",\"phone\":\"58624165\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"1\",\"updateBy\":\"1\",\"updateDate\":\"2017-03-01 15:28:56\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"\",\"areaId\":\"c9cea5ce80ec43e29961b8b5d1fb1180\",\"code\":\"10000555\",\"createBy\":\"df5609891cde43039edca2aa3adc3b86\",\"createDate\":\"2017-03-01 17:22:25\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"1\",\"id\":3,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"湖南嘉迅恒通物流有限公司\",\"parent\":null,\"parentId\":\"1\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"1\",\"updateBy\":\"1\",\"updateDate\":\"2017-04-18 16:57:24\",\"useable\":\"1\",\"zipCode\":\"\"},{\"address\":\"\",\"areaId\":\"8d3e004ead174d5b9fed355fc4e49f11\",\"code\":\"100000002\",\"createBy\":\"1\",\"createDate\":\"2017-03-01 15:30:10\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"1\",\"id\":4,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"湖南华顺金安保安服务有限公司\",\"parent\":null,\"parentId\":\"1\",\"phone\":\"55559110\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"2\",\"updateBy\":\"1\",\"updateDate\":\"2017-03-01 15:30:10\",\"useable\":\"1\",\"zipCode\":\"411101\"},{\"address\":\"\",\"areaId\":\"90e38569c423465f87607a48ccf1a512\",\"code\":\"10000888\",\"createBy\":\"df5609891cde43039edca2aa3adc3b86\",\"createDate\":\"2017-03-01 17:21:25\",\"delFlag\":\"0\",\"deputyPerson\":\"\",\"email\":\"\",\"expanded\":null,\"fax\":\"\",\"grade\":\"1\",\"id\":5,\"isleaf\":null,\"level\":null,\"list\":[],\"loaded\":null,\"master\":\"\",\"name\":\"锦绣氘（武汉）科技有限公司\",\"parent\":null,\"parentId\":\"1\",\"phone\":\"\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":30,\"type\":\"1\",\"updateBy\":\"1\",\"updateDate\":\"2017-04-18 16:57:58\",\"useable\":\"1\",\"zipCode\":\"\"}],\"loaded\":null,\"master\":\"\",\"name\":\"华顺集团\",\"parent\":null,\"parentId\":\"0\",\"phone\":\"58624165\",\"primaryPerson\":\"\",\"remarks\":\"\",\"sort\":10,\"type\":\"1\",\"updateBy\":\"1\",\"updateDate\":\"2017-03-01 15:19:53\",\"useable\":\"1\",\"zipCode\":\"411101\"}}";
        JSONObject obj = JSONObject.parseObject(jsonStr);
        JSONObject ar = obj.getJSONObject("list");
//        JSONArray array = JSONArray.parseArray(jsonStr);
//        System.out.println(array);
    }





}
